package errorTest;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 黎鹤舞
 * Date: 2023-11-28
 * Time: 11:00
 */

class Student implements Cloneable{
    public String name;
    public int age;

    //构造方法:
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class CloneTest {

    public static void main(String[] args) throws CloneNotSupportedException {
        Student s1 = new Student("张三",18);
        Student s2 = (Student) s1.clone();
    }
}
